import './assets/main.css'

import { createApp } from 'vue'

import '@/styles/index.scss'

import App from './App.vue'
import router from './router'

const app = createApp(App)

// 使用 Pinia 状态管理
import { pinia } from './plugins/pinia'

// 使用 element-plus
import { ElementPlus, importElementPlusIcons } from './plugins/element-plus'

// 使用 vxe-table
import { lazyVxeTable } from './plugins/vxe-table'

// 使用 i18n
import { i18n } from './stores/i18n'

// 挂载自定义组件
import * as components from '@/components/index'
for (const [key, component] of Object.entries(components)) {
  app.component(key, component)
}

app
  .use(pinia)
  .use(ElementPlus)
  .use(importElementPlusIcons)
  .use(lazyVxeTable)
  .use(i18n)
  .use(router)

app.mount('#app')
